import request from '@/request/request'

// 获取支出单列表
export function getExpenseBillList(params) {
  return request({
    url: '/finance/expenseBill/list',
    method: 'get',
    params
  })
}

// 获取支出单详情
export function getExpenseBillDetail(id) {
  return request({
    url: `/finance/expenseBill/detail/${id}`,
    method: 'get'
  })
}

// 新增支出单
export function addExpenseBill(data) {
  return request({
    url: '/finance/expenseBill/add',
    method: 'post',
    data
  })
}

// 修改支出单
export function updateExpenseBill(data) {
  return request({
    url: '/finance/expenseBill/update',
    method: 'put',
    data
  })
}

// 删除支出单
export function deleteExpenseBill(id) {
  return request({
    url: `/finance/expenseBill/delete/${id}`,
    method: 'delete'
  })
}

// 批量删除支出单
export function batchDeleteExpenseBill(ids) {
  return request({
    url: '/finance/expenseBill/batchDelete',
    method: 'delete',
    data: ids
  })
}

// 审核支出单
export function approveExpenseBill(id) {
  return request({
    url: `/finance/expenseBill/approve/${id}`,
    method: 'put'
  })
}

// 批量审核支出单
export function batchApproveExpenseBill(ids) {
  return request({
    url: '/finance/expenseBill/batchApprove',
    method: 'put',
    data: ids
  })
}

// 导出支出单
export function exportExpenseBill(params) {
  return request({
    url: '/finance/expenseBill/export',
    method: 'get',
    params
  })
}

// 获取支出单统计
export function getExpenseBillStats(params) {
  return request({
    url: '/finance/expenseBill/stats',
    method: 'get',
    params
  })
} 